<?php
/**
 ***** 扶摇而上、抱守本真 ******
 * @author Dana
 * @Date 2021/6/8
 */

class Dog{
    private $name;

    public function __construct($name)
    {
        $this->name = $name;
    }

    public function getName()
    {
        return $this->name;
    }
}

$dogClass = new ReflectionClass('Dog');
$dogClass->newInstance('Jasica');
var_dump($dogClass);
$dogInstance = $dogClass->newInstanceWithoutConstructor();
var_dump($dogInstance);
var_dump($dogInstance->getName);